class PostSweeper < ActionController::Caching::Sweeper
	observe Post, Comment
	
	def after_create(item)
		expire(item)
	end
	
	def after_update(item)
		expire(item)
	end
	
	def after_destroy(item)
		expire(item)
	end
	
	private
	
	def expire(item=nil)
		expire_fragment(%r{posts*})
	end
end
